'use strict'
const fs = require('fs');
const os = require('os');
// const path = require('path');
let adtlpath, now_adtlpath;
if (os.type() == 'Linux') {
    console.log(14)
    adtlpath = './build/adtl.AppImage';
    now_adtlpath = './build/adtl-' + process.env.npm_package_version + '.AppImage';
    let snappath = './build/adtl.snap';
    let now_snappath = './build/adtl_' + process.env.npm_package_version + '_amd64.snap';
    fs.copyFileSync(now_snappath, snappath);
} else {
    if (os.type() == 'Windows_NT') {
        adtlpath = './build/adtl.exe';
        now_adtlpath = './build/adtl-' + process.env.npm_package_version + '.exe';

    } else {
        adtlpath = './build/adtl.AppImage';
        now_adtlpath = './build/adtl-' + process.env.npm_package_version + '.AppImage';

    }
}
let adtlexc = fs.existsSync(adtlpath);
if (adtlexc) {
    fs.unlinkSync(adtlpath);
}


let adtlexc2 = fs.existsSync(now_adtlpath);
if (adtlexc2) {
    fs.copyFileSync(now_adtlpath, adtlpath);
    console.log("已经生成新的文件:", adtlpath, os.type())

}



